CAMEL-24495: camel-salesforce-maven-plugin - support JWT and Client Credentials authentication, backport to camel-4.22.x - #25976
Conversation
…redentials authentication The Maven plugin previously only supported Username-Password authentication, hardcoding the grant type in the codegen layer. With Salesforce retiring the USERNAME_PASSWORD grant type in Winter '27 (February 2027), this adds support for JWT and Client Credentials flows. Changes: - Add authenticationType parameter to explicitly select the auth type - Refactor codegen login config to use no-arg constructor + setters, enabling auto-detection from provided credentials - Make userName optional (not needed for Client Credentials) - Add Mojo-level validation for ambiguous credential combinations - Add manual integration tests for all three authentication types - Refactor AbstractSalesforceMojoTest into a utility class holding only static setup helpers; move login tests into CamelSalesforceLoginManualIT to separate test infrastructure from test logic - Update README.md with per-auth-type requirements and examples Note: without the ambiguity validation, omitting the password while providing clientSecret and userName would silently auto-detect Client Credentials instead of failing for Username-Password. The Mojo now rejects this combination early with an actionable error message. (cherry picked from commit b4164ad) The upgrade-guide entry from main's camel-4x-upgrade-guide-4_23.adoc is dropped here: that file doesn't exist on this branch, and per this project's convention upgrade-guide entries for a backported change belong in the matching camel-4x-upgrade-guide-4_XX.adoc file on main (a follow-up there covering the 4.22.x line), not duplicated onto the maintenance branch itself. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 10 tested, 29 compile-only — current: 10 all testedMaveniverse Scalpel detected 39 affected modules (current approach: 10).
|
gnodet
left a comment
There was a problem hiding this comment.
Approving this backport of #25876 to camel-4.22.x.
The original PR was reviewed and approved — the backport carries the same changes (minus the upgrade guide entry, which is main-only). Same files modified, same logic.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Backport to
camel-4.22.xof #25876, already reviewed and merged onmain.b4164ad8)Motivation. Salesforce is retiring the
USERNAME_PASSWORDgrant type in Winter '27 (February 2027). The plugin previously only supported Username-Password authentication, with the grant type hardcoded in the codegen layer. This adds support for the JWT and Client Credentials flows via an explicitauthenticationTypeparameter, with auto-detection from whichever credentials are provided, plus Mojo-level validation that rejects ambiguous credential combinations early.Not a straight cherry-pick — one conflict, mechanical.
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adocdoesn't exist on this branch. Per this project's convention, upgrade-guide entries for a backported change belong in the matchingcamel-4x-upgrade-guide-4_XX.adocfile onmain, not duplicated onto the maintenance branch — so that hunk is dropped here.Follow-up needed on
main: this backport's fix should get an entry incamel-4x-upgrade-guide-4_22.adoconmaindocumenting the change for the 4.22.x line, per the project's backport upgrade-guide policy. Flagging this so it isn't missed — not done as part of this PR.Built and tested
camel-salesforce-codegenandcamel-salesforce-maven-pluginon this branch, including the newSalesforceMojoValidationTest.Claude Code on behalf of davsclaus
Backport of #25876
Original PR: #25876 - CAMEL-24495: camel-salesforce-maven-plugin - support JWT and Client Credentials authentication
Original author: @tmielke
Target branch:
camel-4.22.x